<%@page import="com.zhiyou.bbs01.TitleDao"%>
<%@page import="com.zhiyou.bbs01.Title"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>显示查询结果</title>
<link rel="stylesheet" type="text/css" href="/bbs/css/title.css"/>
</head>
<body>
	<%
		ArrayList<Title> list = (ArrayList<Title>)request.getSession().getAttribute("select_title");
		if(list !=null){ %>
			<table class="All_table">
		<% 	for (Title t : list ){ %>
				<tr>
					<th class="all_td_th"><a href="/bbs/showTitle_servlet?tid=<%=t.getTid() %>"> <%=t.getThead() %></a></th>
				</tr>
				<tr>
					<td class="all_td_th"><textarea disabled="disabled" class="text_content2" name="tcontent" required="required" rows="20" cols="80"><%=t.getTcontent() %></textarea></td>
				</tr>
			<% }%>
			</table>
	<%	
	}else{
		TitleDao td = new TitleDao();//创建titltdao对象
		ArrayList<Title> list2 = td.selectKeyWord("");//调用查询方法获取对象集合 %>
		<table class="All_table">
		<% 	for (Title t : list2 ){ %>
				<tr>
					<th class="all_td_th"><a href="/bbs/showTitle_servlet?tid=<%=t.getTid() %>"> <%=t.getThead() %></a></th>
				</tr>
				<tr>
					<td class="all_td_th"><textarea disabled="disabled" class="text_content2" name="tcontent" required="required" rows="20" cols="80"><%=t.getTcontent() %></textarea></td>
				</tr>
			<% }%>
			</table>
	<%} %>
</body>
</html>